﻿# -*- encoding: utf-8 -*- 
from itertools import groupby
from datetime import datetime, timedelta

from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_is_zero, float_compare, DEFAULT_SERVER_DATETIME_FORMAT
from odoo.tools.misc import formatLang

import odoo.addons.decimal_precision as dp

class fhgroups_tb_path(models.Model):
    _name = 'fhgroups.tb_path'
    _description = u'模块地址'
    #_rec_name='FClass'	
	
	
    moldepath=fields.Char(u'模块地址',readonly=False,required=False,translate=False)
  
					   



    @api.model		
    def action_funproved0(self):
        #context = context or {}
        t=fields.datetime.now()
        #huid=self.get_employee(cr,uid,context)
        self.write({'state':'wait_prove','FAdddate':t})       
        return True
		
    @api.model		
    def action_funproved(self):
        #context = context or {}
        t=fields.datetime.now()
        #huid=self.get_employee(cr,uid,context)
        self.write({'state':'proved','FAdddate':t})       
        return True	
		
    @api.multi
    @api.onchange('write_date')	
    def FClassbb_id_change(self):
        vals={}
        #raise osv.except_osv(_('提示2!'), _(FSchedule))
        tinfo_FSchedule=None
        tinfo_ID=0
        tinfo_FSubject=""		
        if self.FAddperson.id !=False :
		
            prod_line_ids002=self.env['hr.employee'].search([('id','=',self.FAddperson.id)])
            tinfo_FSchedule=self.env['hr.employee'].browse(prod_line_ids002)
            for n in tinfo_FSchedule:
                tinfo_ID=n.id				
        vals={'fdepartment':tinfo_ID}
        return {'value': vals}	
	
    @api.model		
    def create(self, vals):
        result = super(fhgroups_tb_path, self).create(vals)	
        return result
    @api.multi		
    def write(self, values):	    
        result = super(fhgroups_tb_path, self).write(values)		
        return result
    @api.multi
    def unlink(self):
	
        return super(fhgroups_tb_path, self).unlink()
    @api.multi
    def copy(self, default=None):
        return super(fhgroups_tb_path, self).copy(default)
    @api.multi
    def search(self, args, offset=0, limit=None, order=None, context=None, count=False):
        domain =None		
        domain = [('state', '=', '0')]		
        return super(fhgroups_tb_path, self).search(args, offset=offset, limit=limit, order=order, count=count)

		
fhgroups_tb_path() #对象定义结束
